﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using PPI.Entities.Lookup;
using PPI.Entities.Utility;

namespace PPI.Entities.Inspections
{
    public class EInspectionStructure : EBasePosition,ICloneable
    {
        private EVendor_Project m_Project;
        private EVendor_Visit_Type m_VisitType;
        private EXMissionStructures_TopType m_Toptype;
        private EVendor_Contact m_Contact;
        private List<EInspection> m_Inspections;
        private Int32 m_Id;
        private EUtility_Asset_XMissionStructure m_UtilityAsset;

        #region Properties

        public int Id
        {
            get { return m_Id; }
            set { m_Id = value; }
        }

        public EVendor_Project Project
        {
            get { return m_Project; }
            set { m_Project = value; }
        }

        public EVendor_Visit_Type VisitType
        {
            get { return m_VisitType; }
            set { m_VisitType = value; }
        }

        public EXMissionStructures_TopType Toptype
        {
            get { return m_Toptype; }
            set { m_Toptype = value; }
        }

        public EVendor_Contact Contact
        {
            get { return m_Contact; }
            set { m_Contact = value; }
        }

        public List<EInspection> Inspections
        {
            get { return m_Inspections; }
            set { m_Inspections = value; }
        }

        public EUtility_Asset_XMissionStructure UtilityAsset
        {
            get { return m_UtilityAsset; }
            set { m_UtilityAsset = value; }
        }



        #endregion

        public EInspectionStructure()
        :base()
        {
            m_Project = new EVendor_Project();
            m_Contact = new EVendor_Contact();
            m_VisitType = new EVendor_Visit_Type();
            m_Inspections = new List<EInspection>();
            m_Id = Int32.MinValue;
            UtilityAsset = new EUtility_Asset_XMissionStructure();
            m_Toptype = new EXMissionStructures_TopType();
        }

        public EInspectionStructure(Int32 id)
        :this()
        {
            m_Id = id;
        }

        public object Clone()
        {

            return this.MemberwiseClone();
        }

        public override string GetHtmlPlacemark()
        {
            StringBuilder html = new StringBuilder();

            foreach (EInspection inspection in m_Inspections)
            {
                html.AppendLine(inspection.GetHtmlPlacemark());
            }
            return html.ToString();
        }
    }
}
